<template>
  <div class="hot">
    <div class="hot_title">人气推荐</div>
    <van-card
      v-for="item in hotGoodsListarr"
      :key="item.id"
      :price="item.retail_price | priceFilter"
      :desc="item.name"
      :title="item.goods_brief"
      :thumb="item.list_pic_url"
    />
    
  </div>
</template>

<script>
export default {
    props:["hotGoodsListarr"],
    filters: {
    // 价格过滤器，所有价格保留两位小数
    priceFilter(money) {
      return money.toFixed(2);
    }
  }
};
</script>

<style lang="less">
.hot {
  padding: 0 4%;
  background: #fff;
  margin-bottom: 10px;
  .hot_title {
    text-align: center;
    line-height: 50px;
    border-bottom: 1px solid #ccc;
  }
  .van-card {
    border-bottom: 1px solid #ccc;
    &:last-of-type {
      border-bottom: 0;
    }
    .van-card__header {
      padding-bottom: 10px;
    }
    .van-card__title {
      font-size: 16px;
      margin-bottom: 10px;
    }
    .van-card__price {
      color: darkred;
    }
  }
}
</style>